//
//  HTAreaModel.m
//  TruckDriver
//
//  Created by Ting Han on 2017/10/10.
//  Copyright © 2017年 Ting Han. All rights reserved.
//

#import "HTAreaModel.h"

@implementation HTAreaModel

+ (instancetype)areaModelWithTitle:(NSString *)title areaType:(HTAreaType)areaType{
    HTAreaModel *model = [[HTAreaModel alloc]init];
    model.title = title;
    model.areaType = areaType;
    return model;
}
- (void)encodeWithCoder:(NSCoder *)aCoder
{
    [aCoder encodeObject:_title forKey:@"title"];
    [aCoder encodeObject:_provinceString forKey:@"provinceString"];
    [aCoder encodeInteger:_areaType forKey:@"areaType"];
    [aCoder encodeObject:_cityString forKey:@"cityString"];
}
- (nullable instancetype)initWithCoder:(NSCoder *)aDecoder
{
    if(self = [super init])
    {
        self.title = [aDecoder decodeObjectForKey:@"title"];
        self.areaType = [aDecoder decodeIntegerForKey:@"areaType"];
        self.provinceString = [aDecoder decodeObjectForKey:@"provinceString"];
        self.cityString = [aDecoder decodeObjectForKey:@"cityString"];
    }
    return self;
}


@end
